package cn.ticket.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.ticket.dao.BusorderMapper;
import cn.ticket.model.Busorder;
import cn.ticket.model.Constants;
import cn.ticket.service.BusOrderService;
@Service
public class BusOrderServiceImpl implements BusOrderService {

	@Autowired
	BusorderMapper busOrderMapper;
	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return busOrderMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Busorder record) {
		// TODO Auto-generated method stub
		return busOrderMapper.insert(record);
	}

	@Override
	public int insertSelective(Busorder record) {
		// TODO Auto-generated method stub
		return busOrderMapper.insertSelective(record);
	}

	@Override
	public Busorder selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return busOrderMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Busorder record) {
		// TODO Auto-generated method stub
		return busOrderMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Busorder record) {
		// TODO Auto-generated method stub
		return busOrderMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Busorder> getAll() {
		// TODO Auto-generated method stub
		return busOrderMapper.getAll();
	}

	@Override
	public List<Busorder> getByCount(int start, int count) {
		// TODO Auto-generated method stub
		return busOrderMapper.getByCount(start, count);
	}

	@Override
	public List<Busorder> getValideOrder0() {
		// TODO Auto-generated method stub
		
		return busOrderMapper.getValideOrder0(new SimpleDateFormat(Constants.DATEFORMAT).format(new Date(new Date().getTime()-1000*60*60*36)));
	}

	@Override
	public List<Busorder> getValideOrder1() {
		// TODO Auto-generated method stub
		return busOrderMapper.getValideOrder1(new SimpleDateFormat(Constants.DATEFORMAT).format(new Date(new Date().getTime()-1000*60*60*36)));
	}

	@Override
	public List<Busorder> getValidateOrders() {
		// TODO Auto-generated method stub
		return busOrderMapper.getValidateOrders();
	}

	@Override
	public List<Busorder> getInvalidateOrders() {
		// TODO Auto-generated method stub
		return busOrderMapper.getInvalidateOrders();
	}

	@Override
	public int seatOccupationRemove1(int id) {
		// TODO Auto-generated method stub
		return busOrderMapper.seatOccupationRemove1(id);
	}

	@Override
	public int seatOccupationAdd1(int id) {
		// TODO Auto-generated method stub
		return busOrderMapper.seatOccupationAdd1(id);
	}

}
